package is202.jsfdemo;

import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

/**
 * This is a CDI (Context and Dependency Injection) backing bean, because
 * it has a @Named annotation. The annotation defines a name that the
 * facelets can use to refer to the bean.
 *
 * The @SessionScoped annotation determines the lifetime of the bean instances,
 * in this case one instance per user session.
 *
 * CDI beans must be serializable (implements Serializable), because the server
 * will save the state to disk when the user is idle, in order to re-use the
 * bean instance with other sessions.
 * @author even
 */
@Named("user")
@SessionScoped
public class UserBean implements Serializable {
    private String name;


    public UserBean() {
        // Nothing to do here, but beans must have a no-parameter (no-args) constructor
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
